package com.example.goodog.customViews;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.View;

import com.example.goodog.R;

public class CallButton extends ListViewButton {

	private String PhoneNumber;
	
	public CallButton(Context c, String i_PhoneNumber) {
		super(c, R.drawable.call);
		
		PhoneNumber = i_PhoneNumber;
		this.setOnClickListener(new View.OnClickListener() {
            
	           @Override
	           public void onClick(View v) {
	                
					 String uri = "tel:" + PhoneNumber.trim() ;
					 Intent intent = new Intent(Intent.ACTION_DIAL);
					 intent.setData(Uri.parse(uri));
					 ((Activity)(v.getContext())).startActivity(intent);               
	           }
	       });
	}
}
